home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13861 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.nask.org.pl!usenet
  2. From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Is this possible?
  5. Date: Wed, 27 Mar 1996 20:15:45 GMT
  6. Organization: Research and Academic Computer Network
  7. Message-ID: <4jc7h7$3hh@bilbo.nask.org.pl>
  8. References: <4j26t6$shm@arl-news-svc-3.compuserve.com>
  9. NNTP-Posting-Host: s112.maloka.waw.pl
  10. X-Newsreader: Forte Free Agent v0.46
  11.  
  12. Philippe Verdy <100105.3120@compuserve.com> wrote:
  13.  
  14. Hi,
  15.  
  16. I think, that there is a problem of SMALL memory model. You have onlu
  17. 64K for your data. Of course you can have a far pointer like:
  18.  
  19. unsigned char far *ptr ;
  20.  
  21. and cast the result of a new operator to unsigned char far* type,
  22. but you are limited with memory that you can allocate in SMALL memory
  23. model. In this model you can got only one segment < 64K for data.
  24. When you call:
  25. ptr[0]=(unsigned char far *)farmalloc(64001);
  26. the result pointer will be proper (!=NULL) only if there is such
  27. memory (not fragmented) to realise your question. I guess, that
  28. program, before this line "has consumed" more than 65K - 64001 of
  29. memory, and you have NULL pointer because of allocation failure. _Not_
  30. because of restriction with far memory allocation.
  31.  
  32. Conclusion - you have to change memory model to have more than one
  33. segment of data - for example for medium.
  34.  
  35. That's all,
  36. Good luck :)
  37.  
  38. Grzegorz
  39.  
  40. ``````````````````````````` Grzes vel Pysiak
  41. Ablue, pecte canem, canis est et permanet idem.
  42. Desunt cetera!
  43.  
  44.